<%--
  Created by IntelliJ IDEA.
  User: 22531
  Date: 2021/6/9
  Time: 23:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">
    <script type="text/javascript" src="/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/js/datagrid-export.js"></script>
    <script src="/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#getAllSC').datagrid({
                url: '/admin/getAllSC',
                title: '学生选课情况',
                columns: [[
                    {field: 'id', title: 'ID', align: 'center'},
                    {field: 'course_name', title: '课程名称', align: 'center'},
                    {field: 'course_id', title: '课程id', align: 'center'},
                    {field: 'stu_id', title: '学生id', align: 'center'},
                    {field: 'stu_name', title: '学生名称', align: 'center'},
                    {field: 'grade',title: "分数",align: 'center',formatter: function(value,row,index){
                           if(row.grade==0){
                               return '暂无分数';
                           }else {
                               return value;
                           }
                        }}

                ]],
                rownumbers: true,
                pagination: true,
                pageSize: 10,
                pageList: [10, 20, 30, 40, 50],
                singleSelect: true,
                toolbar:'#toolbar',
            });
        })
    </script>
</head>
<body>
<div class="easyui-panel" data-options="fit:true,border:false">
    <table id="getAllSC"></table>
</div>

<div id="toolbar">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-reload" plain="true" onclick="$('#getAllSC').datagrid('reload')">刷新</a>
    <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" onclick="$('#getAllSC').datagrid('toExcel','dg.xls')">ExportToExcel</a>
   </div>
</body>
</html>
